import request from "@/utils/request";
import { download, downloadOfGet } from "@/utils/request";
export function getPointStatisticsData(data) {
  return request({
    url: "/device/getPointStatisticsData",
    method: "post",
    data,
  });
}
// 拓扑图数据
export function getNetTopologyData(params) {
  return request({
    url: "/device/getNetTopologyData",
    method: "get",
    params,
  });
}
// 软件进程
export function getDeviceServiceInfo(params) {
  return request({
    url: "/device/getDeviceServiceInfo",
    method: "get",
    params,
  });
}
// 弹窗 基本信息
export function getDeviceXmlDetailData(params) {
  return request({
    url: "/device/getDeviceXmlDetailData",
    method: "get",
    params,
  });
}
// 弹窗 板卡列表
export function findModByMcpCode(params) {
  return request({
    url: "/device/findModByMcpCode",
    method: "get",
    params,
  });
}
// 弹窗 列表
export function getHistoryListById(params) {
  return request({
    url: "/diagnoseRuleConfig/deviceDiagnoseResult/list",
    method: "get",
    params,
  });
}
// 弹窗 趋势图
export function getHistoryData(params) {
  return request({
    url: "healthRecord/getHistoryData",
    method: "get",
    params,
  });
}

// 测点监控
// 柱状图右侧查询某设备历史趋势图
// deviceId,startTime(非必传)，endTime(非必传)，默认查询24小时内的
export function getPointDataByTime(data) {
  return request({
    url: "/cloudiip/getPointDataByTime",
    method: "post",
    data,
  });
}
// 健康状态汇总
// 设备类型
export function deviceType() {
  return request({
    url: "/deviceTypeMeta/deviceTypeMeta/list",
    method: "get",
    // params: data,
  });
}
// 列表
export function getDeviceStatusInfoList(data) {
  return request({
    url: "/healthRecord/getDeviceStatusInfoList",
    method: "get",
    params: data,
  });
}
// 导出
export function listExport(data) {
  return download("/healthRecord/export", data, "健康状态汇总表.xlsx");
}
export function getDeviceStatusDistribution() {
  return request({
    url: "/healthRecord/getDeviceStatusDistribution",
    method: "get",
  });
}
export function getDeviceHealthDistribution() {
  return request({
    url: "/healthRecord/getDeviceHealthDistribution",
    method: "get",
  });
}
export function getPointStatusDistribution() {
  return request({
    url: "/healthRecord/getPointStatusDistribution",
    method: "get",
  });
}
// 资源监控-----
// 列表
export function getHostDeviceInfo(data) {
  return request({
    url: "/device/getHostDeviceInfo",
    method: "get",
    params: data,
  });
}
// 导出
export function exportHostInfo(data) {
  return download("/device/exportHostInfo", data, "主机资源监控表.xlsx");
}

// 板卡 查询板卡通道信息的接口：传参是板卡编码 modCode
export function findChannelByMod(data) {
  return request({
    url: "/device/findChannelByMod",
    method: "get",
    params: data,
  });
}

// 查询板卡实时状态的接口：传参是板卡编码modCode
export function getModStatusInfo(data) {
  return request({
    url: "/device/getModStatusInfo",
    method: "get",
    params: data,
  });
}
